<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\ItemSkuValue
 *
 * @property int $itemid 商品ID
 * @property int $attr_id 属性D
 * @property string $attr_value 属性值
 * @property string|null $attr_img 图片
 * @property-read \App\Models\ItemSkuAttr $attr
 * @property-read \App\Models\Item $item
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ItemSkuValue whereAttrId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ItemSkuValue whereAttrImg($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ItemSkuValue whereAttrValue($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ItemSkuValue whereItemid($value)
 * @mixin \Eloquent
 */
class ItemSkuValue extends Model
{
    protected $table = 'item_sku_value';
    protected $primaryKey = null;
    protected $guarded = [];

    public $timestamps = false;

    public function item()
    {
        return $this->belongsTo(Item::class, 'itemid', 'itemid');
    }

    public function attr()
    {
        return $this->belongsTo(ItemSkuAttr::class, 'attr_id', 'attr_id');
    }
}
